package com.ylbh.modules.userauths.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ylbh.common.pojo.member.vo.MemberVO;
import com.ylbh.common.pojo.userauth.UserAuthDTO;
import com.ylbh.common.pojo.userauth.vo.ShoppingUserAuthVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Mapper
@Repository
public interface ShoppingUserAuthMapper extends BaseMapper<ShoppingUserAuthVO> {

    /**
     * 授权列表
     * @param userAuthDTO
     * @return
     */
    List<ShoppingUserAuthVO> selectToGrantAuthorizationList(@Param(value = "userAuthDTO") UserAuthDTO userAuthDTO, Page page);

    /**
     * 删除第三方授权信息记录
     * @param userId
     */
    void updateUserAuthByUserId(Integer userId);

    /**
     * 查询出用户的手机号
     * @param userId
     * @return
     */
    MemberVO selectMobileByUserId(Integer userId);

    /**
     * 修改用户表中的用户信息，在手机号后加个a，并把上级修改成1
     * @param userId
     * @param mobile
     * @param cancellationStatus
     */
    void updateUserDetailsByUserId(Integer userId, String mobile, Integer cancellationStatus, String userName);
}
